package top.frsf.pattern.b_structural.b_proxy.a_statics;

import lombok.Data;
import top.frsf.pattern.b_structural.b_proxy.pojo.RealSubject;
import top.frsf.pattern.b_structural.b_proxy.pojo.Subject;

/**
 * @author He Kuntao
 * @since 2024/9/18 16:33
 */
@Data
public class SubjectProxy implements Subject {

    private final RealSubject realSubject;

    @Override
    public void request() {
        beforeRequest();
        realSubject.request();
        afterRequest();
    }


    private void beforeRequest(){
        System.out.println("[proxy]: before params process");
    }

    private void afterRequest(){
        System.out.println("[proxy]: after response header");
    }
}
